<template>
  <!-- <el-container>
    <el-aside width="200px" class="asideClass">
      <el-menu default-active="/hardwareAssets" router unique-opened class="el-menu-vertical-demo">
        <template v-for="(item,itemsIndex) in items">
          <el-submenu :index="itemsIndex" :key="itemsIndex" v-if="item.children">
            <template slot="title">
              <i :class="item.icon"></i>
              <span>{{item.name}}</span>
            </template>
            <el-menu-item-group v-for="(childrenItem,childrenIndex) in item.children" :key="childrenIndex">
              <el-menu-item :index="String(childrenItem.url)">
                <span class="span" :title="childrenItem.name">
                  <i :class="childrenItem.icon"></i>
                  {{childrenItem.name}}
                </span>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <template v-else>
            <el-menu-item :index="String(item.url)" :key="item.url">
              <i :class="item.icon"></i>
              <span slot="title" style="font-weight:600">{{item.name}}</span>
            </el-menu-item>
          </template>
        </template>
      </el-menu>
    </el-aside>
    <el-main>
      <div style="overflow:'auto;">
        <transition name="move" mode="out-in">
          <router-view></router-view>
        </transition>
      </div>
    </el-main>
  </el-container> -->
  <div>
    <Maherder></Maherder>
  </div>
</template>
<script>
import Maherder from "@/components/asiders.vue";
//引入侧导航组件
export default {
  data() {
    return {
      asideHeight: "",
      collapse: false,
      onRoutes: "",
      items: [
        {
          name: "主机资产",
          url: "/",
          icon: "el-icon-menu",
          children: [
            {
              name: "硬件资产",
              url: "/hardwareAssets",
              icon: "el-icon-bank-card",
              children: [],
            },
            {
              name: "软件资产",
              url: "/softwareAssets",
              icon: "el-icon-bank-card",
              subset: [],
            },
          ],
        },
        {
          name: "移动介质资产",
          url: "/",
          icon: "el-icon-menu",
          children: [
            {
              name: "红盘管理",
              url: "/redDisk",
              icon: "el-icon-bank-card",
              children: [],
            },
          ],
        },
      ],
    };
  },
  created() {
    if (this.items.children.length !== 0) {
      this.onRoutes = this.items[0].children[0].url;
    } else {
      this.onRoutes = this.items[0].url;
    }
  },
  components: {
    //注册侧导航组件
    Maherder,
  },
  mounted: {
    setTableHeight() {
      let clientHeiht =
        window.innerHeight || document.documentElement.clientHeight;
      this.asideHeight = clientHeiht - 10 + "px";
      console.log(this.asideHeight);
    },
  },
};
</script>
<style scoped>
/* .asideClass {
  height: 99vh;
} */
.el-menu {
  height: 100%;
}
</style>